package org.example.bean.enums;

import lombok.Getter;

@Getter
public enum HomeSubType {

    /**
     * POP
     */
    POP(0, "POP"),
    /**
     * OPT
     */
    OPT(1, "OPT"),
    /**
     * 待付款
     */
    WAIT_PAY(2, "待付款"),
    /**
     * 已付款
     */
    PAY(3, "已付款"),
    /**
     * 竟得
     */
    WEARNINGS(4, "竟得"),
    /**
     * 新增POP店数
     */
    POP_SHOP(5, "新增POP店数"),
    /**
     * 竞得（项目类）
     */
    PROJECT_WEARNINGS(6, "竞得（项目类）"),

    SUCCESS(7, "成交"),

    INQUIRY_QUALITY(8, "询价质检");

    private final Integer code;

    private final String description;

    HomeSubType(Integer code, String description) {
        this.code = code;
        this.description = description;
    }

    public static HomeSubType ofCode(Integer code) {
        for (HomeSubType type : HomeSubType.values()) {
            if (type.getCode().equals(code)) {
                return type;
            }
        }
        return null;
    }
}
